import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout/index.vue'
import HomeView from '@/views/HomeView.vue'

export const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    hidden: true // hidden default false
  },
  // {
  //   path: '/button',
  //   name: 'button',
  //   // route level code-splitting
  //   // this generates a separate chunk (About.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/ButtonView.vue')
  // },
  {
    name: 'component',
    path: '/component',
    component: Layout,
    children: [
      {
        name: "component-button",
        path: '/component/button',
        component: () => import('../views/ButtonView.vue'),
        meta: {
          title: "Button"
        }
      },
      {
        name: "component-icon",
        path: '/component/icon',
        component: () => import('../views/IconView.vue'),
        meta: {
          title: "Icon"
        }
      },
      {
        name: "component-loading",
        path: '/component/loading',
        component: () => import('../views/LoadingView.vue'),
        meta: {
          title: "Loading"
        }
      },
      {
        name: "component-notification",
        path: '/component/notification',
        component: () => import('../views/NotificationView.vue'),
        meta: {
          title: "Notification"
        }
      },
      {
        name: "component-skeleton",
        path: '/component/skeleton',
        component: () => import('../views/SkeletonView.vue'),
        meta: {
          title: "Skeleton"
        }
      },
      {
        name: "component-empty",
        path: '/component/empty',
        component: () => import('../views/emptyView.vue'),
        meta: {
          title: "Empty"
        }
      },
    ]
    // route level code-splitting
    // this generates a separate chunk (About.[hash].js) for this route
    // which is lazy-loaded when the route is visited.

  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
